<html>
<form name="input" action='motion.php' method="post">
Acceleration: <input type='text' name="acceleration" size='12' /> <br />
Timestep: <input type='text' name="timestep" size='12'  /> <br /> 
Initial Velocity: <input type='text' name="init_velocity" size='12'  /> <br />
<input type='submit' value='Submit' />
</form>
</html>
<?php

function calculate($acceleration, $timestep, $init_velocity)
{
	$velocity = $init_velocity + ($acceleration * $timestep);
	$position = $velocity * $timestep;
	return "Your position is " . $position . " and your velocity is " . $velocity . " after a timestep of " . $timestep . ".";
}

echo calculate($_POST["acceleration"], $_POST["timestep"], $_POST["init_velocity"]);
?>